<div class="left_bar">
    <div class="left_box shoye_box">
        <div class="title">
            <a href="{:url('index/index')}" >
                <i><img src="__STATIC__/index/imgs/hou_home.png" alt=""></i>
                <span>首页</span>
            </a>
        </div>
    </div>
    <!-- 医生端管理 -->



    {volist name="left_menu" id="menu"}
    {if condition="$menu['menuurl'] == '' && count($menu['second']) == 0"}
    <php>continue;</php>
    {/if}

    <div class="left_box">
        <div class="title slide_slide">
            <a>

                <i><img src="__STATIC__/index/imgs/{$menu['icon']}" alt=""></i>

                <span>{$menu.menuname}</span>
            </a>
        </div>

        <div class="left_detail">

            {if condition="count($menu['second']) gt 0"}
            <ul>
                {volist name="menu['second']" id="submenu"}


                <li class="find_menuurl">
                    <a href="{$submenu['menuurl']|url}" data-url="{$submenu['menuurl']}">
                    {$submenu.menuname}
                    </a>
                </li>
                {/volist}

            </ul>
            {/if}
        </div>
    </div>

    {/volist}
</div>

<script>
    $(function(){
        var default_controller = "{$Request.controller}";
        var default_action = "{$Request.action}";
        default_controller =  default_controller.toLowerCase();
        default_action =  default_action.toLowerCase();
       var default_path = default_controller+"/"+default_action;

        if(default_path == 'index/index'){

           $("#index_index").addClass('on');
        }else{
            $(".find_menuurl").find('a').each(function(){
               var dataurl = $(this).attr('data-url');
                if(dataurl == default_path){
                    $(this).addClass('on');
                }
            });
        }
    })

    $(".backgroud_content .left_bar  .slide_slide").toggle(function(){
        console.log(1);
        $(this).parent().find(".left_detail").slideDown();
    },function(){
        console.log(1);
        $(this).parent().find(".left_detail").slideUp();
    });
</script>

